import install from "./install.js";
import Store from "./store.js";
export function mapState(stateList) {
  let obj = {};
  for (let i = 0; i < stateList.length; i++) {
    let stateName = stateList[i];
    obj[stateName] = function () {
      return this.$store.state[stateName];
    };
  }
  return obj;
}

export function mapGetters(getterList) {
  let obj = {};
  for (let i = 0; i < getterList.length; i++) {
    let getterName = getterList[i];
    obj[getterName] = function () {
      return this.$store.getters[getterName];
    };
  }
  return obj;
}

export function mapMutations(mutationList) {
  let obj = {};
  for (let i = 0; i < mutationList.length; i++) {
    let mutationName = mutationList[i];
    obj[mutationName] = function (payload) {
      this.$store.commit(mutationName, payload);
    };
  }
  return obj;
}

export function mapActions(actionList) {
  let obj = {};
  for (let i = 0; i < actionList.length; i++) {
    let actionName = actionList[i];
    obj[actionName] = function (payload) {
      this.$store.dispatch(actionName, payload);
    };
  }
  return obj;
}
export default {
  install,
  Store,
  // mapState,
  // mapMutations,
  // mapActions,
  // mapGetters,
};
